<link rel="stylesheet" type="text/css" href="/static/css/common.css">
<style type="text/css">
table{
	border-collapse: collapse;
}
tr td{
	border-bottom: 1px dashed #DDD;
}
.big-btn{
	width: 60px;
	height: 100px;
}
.level-group{
	float: left;
	border: 1px solid #DDD;
}
.level-group button{
	padding:5px 8px;
	margin: 10px 10px;
	border-radius: 5px;
}
.group1 button{
	background: #F2FEFE; 
}
.group2 button{
	background: #FEF2FE; 
}
.group3 button{
	background: #FEFEF2; 
}
</style>

{pager count=$count pagesize=$pageSize page=$smarty.get.p pagelink="rateFront?p=%d" list=5}

<table>
	<th>
		<td>操作</td>
		<td>id</td>
		<td>图片</td>
		<td>来源</td>
		<td>打分</td>
		<td>删除</td>
	</th>
	{foreach from=$arrPictureList item=item}
	<tr>
		<td><input role="checkbox" value="{$item.id}" type="checkbox"> </td>
		<td>{$item.id}</td>
		<td><img src="{$item.pic_url}" width="200" /></td>
		<td>{$item.source}</td>
		<td width="400">
			<div class="level-group group1">
				<button request="rateScoreFront?id={$item.id}&level=10" click-hide="tr">极品(上)</button>
				<button request="rateScoreFront?id={$item.id}&level=9" click-hide="tr">极品(中)</button>
				<button request="rateScoreFront?id={$item.id}&level=8" click-hide="tr">极品(下)</button>
			</div>
			<div class="level-group group2">
				<button request="rateScoreFront?id={$item.id}&level=7" click-hide="tr">上品(上)</button>
				<button request="rateScoreFront?id={$item.id}&level=6" click-hide="tr">上品(中)</button>
				<button request="rateScoreFront?id={$item.id}&level=5" click-hide="tr">上品(下)</button>
			</div>
			<div class="level-group group3">
				<button request="rateScoreFront?id={$item.id}&level=4" click-hide="tr">中品(上)</button>
				<button request="rateScoreFront?id={$item.id}&level=3" click-hide="tr">中品(中)</button>
				<button request="rateScoreFront?id={$item.id}&level=2" click-hide="tr">中品(下)</button>
			</div>
		</td>
		<td><button request="deleteFront?id={$item.id}" click-hide="tr" class="big-btn">删除</button></td>
	</tr>
	{/foreach}
</table>

{pager count=$count pagesize=$pageSize page=$smarty.get.p pagelink="rateFront?p=%d" list=5}

<script type="text/javascript" src="/static/js/jquery-1.7.1.js"></script>
<script type="text/javascript">
$('[request]').click(function(evt){
	$.get($(this).attr('request'));
});
$('[click-hide]').click(function(evt){
	var toHide = $(this).attr('click-hide');
	if(toHide){
		$(this).parents(toHide).hide();
	} else{
		$(this).hide();
	}
})
</script>
